require File.dirname(__FILE__) + '/initializers'

trap 'INT' do raise 'Program interrupted' end

puts 'Initialize RadiaStore daemon...'

@daemon = StorageManager.new

@daemon.start_management

begin
  loop { sleep 5 }
rescue
  puts "Bye, bye"
ensure
  @daemon.end_management
end